<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8"/>
	<title>demo</title>
	<meta name="keywords" content=""/>
	<meta name="description" content=""/>
	<meta name="viewport" content="width=device-width"/>
	<link rel="shortcut icon" href="img/touchicon.png"/>
	<link rel="stylesheet" href=""/>
	<style type="text/css">
		.clearfix:after{content:'.';display:block;clear:both;height:0;overflow:hidden;visibility:hidden;}
		.clearfix{zoom:1;}
	</style>
</head>
<body>
	<script>
		var arr = [1,10,23,27,97,70,46,15,8,37];
		function myMap(arr,fcn){
			var a = [];
			for(var i in arr){
				if(fcn(arr[i])){
					a.push(arr[i]);
				}
			}
			return a;
		}
		function foo(a){
			if (a%2==0) {
				return true;
			} else {
				return false;
			}
		}
		function foo1(a){
			if (a%2==1) {
				return true;
			} else {
				return false;
			}
		}
		var b = myMap(arr,foo);
		var c = myMap(arr,foo1);
	</script>
</body>
</html>